<template>
  <div class="boxsell">

    <div class="boxsellhead">
      <dl>
        <dd class="boxsellhead1">爆款折扣区</dd>
      </dl>
    </div>
    <div class="boxsellmain">
      <dl>
        <dd v-for="(item, index) in dataList" :key="index">
          <img :src="item.goodsImgSrc"/>
          <h3>{{item.goodsName}}</h3>
          <p>{{ item.goodsColor }}</p>
          <h2>{{item.goodsSize}}</h2>
          <h4>￥{{item.oldPrice}}</h4>
        </dd>
      </dl>


    </div>

  </div>
</template>

<script>
import axios from 'axios';
export default {
  data() {
    return {
      dataList: []
    }
  },
  created() {
    this.getData()
  },
  methods: {
    getData() {
      axios.get('http://192.168.0.239:8081/goods/allGoods').then( res => {
        console.log(res)
        if(res.data.code === 200) {
          this.dataList = res.data.goodsList
          this.dataList.length = 4
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
<style src="../../assets/CSS/Main.css"></style>